# class MyException(Exception):
#     def __init__(self, parameter):
#         err = '非法入参{0}，分母不能为0'.format(parameter)
#         Exception.__init__(self, err)
#         self.parameter = parameter
#
#
#
#
# def my_fun(x):
#     if x == 0:
#         raise MyException(x)
#     return 12 / x
#
#
# print(my_fun(0))


def my_func():
    try:
        print(10 / 0)
    except ZeroDivisionError:
        print("除数不能为0")
        # 此处直接将捕获的异常抛出
        raise


my_func()
